package com.jsh.erp.datasource.entities;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
public class DepotItemVoSta implements Serializable {

    private static final long serialVersionUID = -1572397909985318704L;

    private String saleDate;
    /**
     * 销售数量
     */
    private BigDecimal outSum;
    /**
     * 销售总价
     */
    private BigDecimal outSumPrice;
    /**
     * 退货数量
     */
    private BigDecimal inSum;
    /**
     * 退货总价
     */
    private BigDecimal inSumPrice;

    /**
     * @return 实际销售数量
     */
    public BigDecimal getOutInSum() {
        if (inSum == null || outSum == null) {
            return null;
        }

        return outSum.subtract(inSum);
    }

    /**
     * @return 实际销售金额
     */
    public BigDecimal getOutInSumPrice() {
        if (inSumPrice == null || outSumPrice == null) {
            return null;
        }

        return outSumPrice.subtract(inSumPrice);
    }
}
